Skip to content

fix: fix incomplete display#546

Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
ut003640:master
Apr 9, 2026
Merged

fix: fix incomplete display#546
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
ut003640:master

Conversation

@ut003640
Copy link
Copy Markdown
Contributor

@ut003640 ut003640 commented Apr 9, 2026

there is extra spacing in the layout, causing display issues.

Log: fix incomplete display
PMS: BUG-353585

fix: 修复显示不全

布局中多了间距,显示有问题

Log: 修复显示不全

Summary by Sourcery

Adjust the network dock applet layout to remove unintended spacing and rely on a fixed layout configuration instead of dynamic minimum height updates.

Bug Fixes:

  • Eliminate extra vertical spacing in the network dock popup to ensure the content is fully visible.

Enhancements:

  • Simplify dock content layout by removing dynamic minimum height handling and enforcing zero spacing between main layout elements.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 9, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the network dock applet layout to remove extra vertical spacing and relies on existing container margin handling, fixing incomplete display issues.

Sequence diagram for updated network applet layout handling

sequenceDiagram
    actor User
    participant Dock
    participant NetworkPlugin
    participant DockContentWidget

    User->>Dock: open network applet
    Dock->>NetworkPlugin: message(jsonMsg)
    NetworkPlugin->>NetworkPlugin: parse jsonMsg to msgObj
    alt msg type is APPLET_CONTAINER
        NetworkPlugin->>DockContentWidget: setMainLayoutMargins(QMargins(0, topMargin, 0, 0))
        DockContentWidget->>DockContentWidget: apply margins and spacing
    else other msg type
        NetworkPlugin->>NetworkPlugin: handle other message types
    end
Loading

Class diagram for updated DockContentWidget layout configuration

classDiagram
    class QWidget
    class DockContentWidget {
        - QVBoxLayout* m_mainLayout
        - QWidget* m_netView
        + DockContentWidget(QWidget* parent)
        + setMainLayoutMargins(QMargins margins)
    }

    DockContentWidget --|> QWidget

    class QVBoxLayout {
        + setContentsMargins(int left, int top, int right, int bottom)
        + setSpacing(int spacing)
        + addWidget(QWidget* widget, int stretch, Qt_Alignment alignment)
    }

    class QMargins {
        + QMargins(int left, int top, int right, int bottom)
    }

    class Qt_Alignment

    DockContentWidget --> QVBoxLayout : uses m_mainLayout
    DockContentWidget --> QWidget : uses m_netView

    %% Updated layout behavior
    DockContentWidget : m_mainLayout->setContentsMargins(0, 10, 0, 0)
    DockContentWidget : m_mainLayout->setSpacing(0)
    DockContentWidget : m_mainLayout->addWidget(m_netView, 0, Qt_AlignTop_AlignHCenter)
    DockContentWidget : m_mainLayout->addWidget(buttonWidget, 0, Qt_AlignBottom)
Loading

File-Level Changes

Change Details Files
Remove handling of explicit minimum height messages and rely on existing applet container layout logic.
  • Delete processing of Dock::MSG_SET_APPLET_MIN_HEIGHT messages in NetworkPlugin::message.
  • Stop calling setMinHeight on m_dockContentWidget based on external messages.
dock-network-plugin/networkplugin.cpp
Tighten the dock content widget layout to eliminate extra vertical spacing between the network view and action buttons.
  • Keep a fixed top margin on the main layout but explicitly set layout spacing to 0.
  • Remove stretch and extra spacing previously added between the network view and the button row, so the content and buttons pack together without unintended gaps.
dock-network-plugin/dockcontentwidget.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Removing the MSG_SET_APPLET_MIN_HEIGHT handling means any min-height commands from the dock will now be ignored; please confirm this message is no longer used or that the behavior change is intentional across all consumers.
  • With the stretch and spacing removed, the bottom button widget may no longer stay visually anchored at the bottom when the container grows; consider using a spacer with adjustable size or layout alignment that preserves the bottom positioning without reintroducing excessive gaps.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Removing the MSG_SET_APPLET_MIN_HEIGHT handling means any min-height commands from the dock will now be ignored; please confirm this message is no longer used or that the behavior change is intentional across all consumers.
- With the stretch and spacing removed, the bottom button widget may no longer stay visually anchored at the bottom when the container grows; consider using a spacer with adjustable size or layout alignment that preserves the bottom positioning without reintroducing excessive gaps.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

there is extra spacing in the layout, causing display issues.

Log: fix incomplete display
PMS: BUG-353585

fix: 修复显示不全

布局中多了间距,显示有问题

Log: 修复显示不全
@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23, ut003640

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ut003640
Copy link
Copy Markdown
Contributor Author

ut003640 commented Apr 9, 2026

/forcemerge

@deepin-bot
Copy link
Copy Markdown
Contributor

deepin-bot bot commented Apr 9, 2026

This pr force merged! (status: unstable)

@deepin-bot deepin-bot bot merged commit 7b4cd8b into linuxdeepin:master Apr 9, 2026
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants